package com.htx.zqs.blesmartmask.bean;

import android.content.Context;
import android.support.annotation.NonNull;

import com.htx.zqs.blesmartmask.utils.Utils;

import java.util.List;

/**
 * Created by Administrator on 2018/7/23.
 */

public class ThirdInfoBean {
    /**
     * msg : 获取成功
     * code : 200
     * data : {"userInfo":[{"id":16,"name":"青春痘","deviceid":"hhhhh","coursedate":"2018-07-21"}],"userInfoCount":1}
     */

    private String msg;
    private int code;
    private DataBean data;

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    public static class DataBean {
        /**
         * userInfo : [{"id":16,"name":"青春痘","deviceid":"hhhhh","coursedate":"2018-07-21"}]
         * userInfoCount : 1
         */

        private int userInfoCount;
        private List<UserInfoBean> userInfo;

        public int getUserInfoCount() {
            return userInfoCount;
        }

        public void setUserInfoCount(int userInfoCount) {
            this.userInfoCount = userInfoCount;
        }

        public List<UserInfoBean> getUserInfo() {
            return userInfo;
        }

        public void setUserInfo(List<UserInfoBean> userInfo) {
            this.userInfo = userInfo;
        }

        public static class UserInfoBean  implements Comparable<UserInfoBean>{
            /**
             * id : 16
             * name : 青春痘
             * deviceid : hhhhh
             * coursedate : 2018-07-21
             */

            private int id;
            private String name;
            private String deviceid;
            private String coursedate;

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getName(Context context) {
                return Utils.getCourseNameInternal(context, coursedate);
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getDeviceid() {
                return deviceid;
            }

            public void setDeviceid(String deviceid) {
                this.deviceid = deviceid;
            }

            public String getCoursedate() {
                return coursedate;
            }

            public void setCoursedate(String coursedate) {
                this.coursedate = coursedate;
            }

            @Override
            public int compareTo(@NonNull UserInfoBean o) {
                return o.id-id;//根据id来排序
            }
        }
    }
}
